package day6;

public class Demo2 {

    static abstract class Drink {
        void dowork() {
            System.out.println("拿杯装水");
            drinking();
            System.out.println("拿杯喝饮料");
        }

        abstract void drinking();
    }

    static class Coffee extends Drink{

        @Override
        void drinking() {
            System.out.println("冲咖啡");
        }
    }

    static class Tea extends Drink{

        @Override
        void drinking() {
            System.out.println("泡茶");
        }
    }

    public static void main(String[] args) {
        Drink coffee = new Coffee();
        Drink tea = new Tea();

        coffee.dowork();
        System.out.println("----------------------------------------------------");
        tea.dowork();
    }
}
